import logging,yaml,yagmail,json
def log_set():
    logging.basicConfig(filename='xuexiqiangguo.txt', level=logging.DEBUG, filemode='w+',
                        format='%(asctime)s->%(levelname)s->%(message)s')
def send_mail(filepath):
    m = yagmail.SMTP(user='1098120615@qq.com',password='thbqnogfppjsgccg',host='smtp.qq.com')
    m.send(to='1098120615@qq.com',subject='测试报告',contents='sadasdd',attachments=filepath)
def get_data(fp):
    with open(fp,'r',encoding='utf-8') as f:
        return yaml.safe_load(f)
def get_data_json(fp):
    with open(fp,'r') as f:
        return json.load(f)